add Method (Validate) |
This method registers the specified element to the validate component.
Syntax
validateID.add(oElement)
Parameters
Parameter |
Description |
---|---|
oElement |
Required. Object that specifies the element that is to be added to the validate component. |
Return Value
No return value.
Remarks
The add method is used especially for adding dynamically created elements in the page, since validate component cannot recognize those elements when they are being validated. Once the element is created, the identifier of the element is passed as an input to the add method to add it to the component. Once added, the element gets validated just like every other static elements in the page.
Example
The following example shows how add method is used.
//sampleElement is the ID of the new element that is created var sampleElement = document.createElement("<input id='sampleElement' fieldType='integer' required>"); //Call add method. validater is the ID of the validate component validater.add(document.all['sampleElement']);